﻿using System;
using System.Collections.Generic;
using System.Text;

using Obsidian.Edm;

namespace Oak.Model
{
    public class BsAdminInfo : OModel, BsIAccountInfo
    {

        private LongField adminId;
        private BoolField isSuperAdmin;
        private StringField adminName;
        private StringField password;
        private StringField email;
        private StringField mobileNo;
        private DateTimeField modified;
        private DateTimeField created;
        private EnumField<AdminStatus> status;
        private EnumField<AccountType> accountType;

        public BsAdminInfo()
        {
            base.InitModel("oak", "BsAdmins", new IModelField[]{
                adminId = new LongField(this, "AdminId", "adminId"),
                isSuperAdmin = new BoolField(this, "IsSuperAdmin", "isSuperAdmin"),
                adminName = new StringField(this, "AdminName", "name"),
                password = new StringField(this, "Password"),
                email = new StringField(this, "Email", "email"),
                mobileNo = new StringField(this, "MobileNo", "mobileNo"),
                modified = new DateTimeField(this, "Modified", "modified"),
                created = new DateTimeField(this, "Created", "created"),
                status = new EnumField<AdminStatus>(this, "Status", "status", EnumFieldToStringCase.LowerCase),
                accountType = new EnumField<AccountType>(this, null, "accountType", Model.AccountType.Admin, EnumFieldToStringCase.LowerCase)
            });
        }

        public LongField AdminId { get { return adminId; } }
        public BoolField IsSuperAdmin { get { return isSuperAdmin; } }
        public StringField AdminName { get { return adminName; } }
        public StringField Password { get { return password; } }
        public StringField Email { get { return email; } }
        public StringField MobileNo { get { return mobileNo; } }
        public DateTimeField Modified { get { return modified; } }
        public DateTimeField Created { get { return created; } }
        public EnumField<AdminStatus> Status { get { return status; } }
        public EnumField<AccountType> AccountType { get { return accountType; } }

        public LongField AccountId { get { return adminId; } }

    }

    public enum AdminStatus
    {
        Normal,
        Disabled
    }
}
